{extend name="admin@index_layout"/}
{block name="main"}
<style type="text/css">
    .childrenBody {
        background: #fff;
    }
</style>

<script type="text/html" id="barTool">

</script>

<div class="layui-card">
    <div class="layui-card-header">数据统计</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="picTpl">
    <img style="max-width:80px; max-height:30px;" src="{{d.img}}" data-image="{{d.name}}">
</script>

{/block}
{block name="script"}
<script>
    layui.use(['table', 'yznTable', 'jquery'], function () {

        $ = layui.$;

        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            add_url: "{:url('add',['catid'=>$catid])}",
            delete_url: "{:url('del',['catid'=>$catid])}",
            modify_url: '{:url("listorder",["catid"=>$catid])}',
        };
        table.render({
            init: init,
            id: 'currentTable',
            elem: '#currentTable',
            url: '{:url("riDetail")}?business_id={$business_id}&goods_id={$goods_id}',
            // search: false,
            // searchFormTpl:false,
            toolbar: ['refresh',
            ],
            cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'id', width: 60, title: 'ID', search: false},
                    {field: 'unit_name',   align: "left", title: '销售单位', search: false},
                    {field: 'goods_name',    align: "left", title: '商品名称', search: false},
                    {field: 'date', align: "left", title: '日期',search: 'range'},
                    {field: 'count_sum', width: 100, align: "left", title: '数量',search: false},
                    {field: 'subtotal_sum', width: 120, align: "left", title: '金额',search: false},
                ]
            ],
            page: {}
        });
        yznTable.bindevent();

        $(document).ready(function () {
            $("#layui-input-search").hide();
        });
    });
</script>
{/block}